.question_content= content
-choices = ["A","B","C","D","E","F"]
.control-group#answer1
  %label.control-label 涂成绿色的国家有
  .controls
    -choices.each do |name|
      .checker
        %span
          %input(type="checkbox" value="#{name}")
      =name
.control-group#answer2
  %label.control-label 涂成黑色的国家有
  .controls
    -choices.each do |name|
      .checker
        %span
          %input(type="checkbox" value="#{name}")
      =name
.control-group#answer3
  %label.control-label 涂成红色的国家有
  .controls
    -choices.each do |name|
      .checker
        %span
          %input(type="checkbox" value="#{name}")
      =name
.control-group#answer4
  %label.control-label 涂成黄色的国家有
  .controls
    -choices.each do |name|
      .checker
        %span
          %input(type="checkbox" value="#{name}")
      =name
:javascript
  function prepare_for_submit()
  {
    var result = {};
    result["1"] = [];
    $("#answer1 input[type='checkbox']:checked").each(function(index, item){
      result["1"].push(item.value);
    })
    result["2"] = [];
    $("#answer2 input[type='checkbox']:checked").each(function(index, item){
      result["2"].push(item.value);
    })
    result["3"] = [];
    $("#answer3 input[type='checkbox']:checked").each(function(index, item){
      result["3"].push(item.value);
    })
    result["4"] = [];
    $("#answer4 input[type='checkbox']:checked").each(function(index, item){
      result["4"].push(item.value);
    })
    return JSON.stringify(result);
  }